package team.se.tms.service;

import org.springframework.web.multipart.MultipartFile;
import team.se.tms.dto.AssignmentFile;
import team.se.tms.dto.AssignmentRelevantDataDetail;
import team.se.tms.dto.JudgeDetail;
import team.se.tms.dto.Page;
import team.se.tms.po.AssignmentInfo;


import java.util.List;

/**
 * Created by argentum on 2018/12/7.
 */
public interface AssignmentInfoService {

    /**
     * 根据用户id与任务id获取作业信息
     *
     * @param userId 用户id
     * @param taskId 任务id
     * @return 作业信息
     * @throws Exception 异常
     * @create on 2018/12/31 by winkyle
     */
    AssignmentFile getAssignmentFile(String userId, String taskId) throws Exception;

    /**
     * 根据用户id与任务id获取作业详细信息
     *
     * @param userId 用户id
     * @param taskId 任务id
     * @param page 分页
     * @return 作业详细信息列表
     * @throws Exception 异常
     * @create on 2019/1/1 by winkyle
     */
    List<AssignmentRelevantDataDetail> listAssignmentRelevantDataDetails(String userId, String taskId, String teachCourseId, Page page) throws Exception;

    List<AssignmentFile> listAssignmentInfos(List<String> projectIds, int type) throws Exception;

    Boolean modifyAssignmentLoadStates(List<String> assignmentIds) throws Exception;

    /**
     * 35查看授课下所有作业相关信息
     *
     * @param page
     * @param teachCourseId
     * @return
     * @throws Exception
     */
    List<AssignmentRelevantDataDetail> listAssignmentDetails(Page page,String teachCourseId) throws Exception;

    List<AssignmentFile> listAssignmentFiles(Page page, String projectId) throws Exception;
    /**
     * 查询最新的作业信息
     *
     * @param projectId 项目Id
     * @return 作业信息
     * @throws Exception 异常
     * @create on 2018/12/26 by sunddly
     */
    AssignmentInfo getLatestAssignmentAppraiseState(String projectId) throws Exception;

    Boolean  saveFlowAssignment(AssignmentInfo assignmentInfo, MultipartFile multipartFile, int type) throws Exception;

    AssignmentFile getAssignmentFile(String assignmentId) throws Exception;

    /**
     * 上传任务作业
     * @create on 2018/12/29 by argentum
     *
     * @param userId
     * @param assignmentInfo
     * @param multipartFile
     * @return
     * @throws Exception
     */
    Boolean saveTaskAssignmentInfo(String userId,String teachCourseId,AssignmentInfo assignmentInfo, MultipartFile multipartFile) throws Exception;

    /**
     * 获取标签与学生成绩
     * @create on 2018/12/29 by argentum
     *
     * @param assignmentId
     * @return
     * @throws Exception
     * @update on 2019/3/21 by winkyle
     */
    JudgeDetail getJudgeDetail(String assignmentId) throws Exception;
//改
    JudgeDetail getJudgeDetailInfo(String assignmentId,String teaId)throws Exception;
}
